package com.ruoyi.common.core.exception.user;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: 张桦阳
 * @Date: 2023-03-22-18:18:29
 * @Description: 类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    private Integer code;

    private boolean status;

    private String message;

    private Object data;

    public static Result success(){
        return new Result(StatusCode.OK,true,"成功",null);
    }

    public static Result success(Object data){
        return new Result(StatusCode.OK,true,"成功",data);
    }

    public static Result error(Integer code,String message){
        return new Result(code,false,message,null);
    }

}
